@namespace FluentCMS.Web.Plugins

<DataTable @key="@Items" Items="Items">
    <DataTableItem Label="Name">
        <Stack>
            <Icon Size="IconSize.Large" Name="@GetFileIcon(context)" />
            <Button @onclick="() => HandleRowClick(context)" Link>
                @context.Name
            </Button>
        </Stack>
    </DataTableItem>
    <DataTableItem Label="Type">
        <Badge Color="Color.Info" Visible="@context.IsFolder">
            Folder
        </Badge>
        <Badge Color="Color.Success" Visible="!context.IsFolder">
            @(string.IsNullOrEmpty(context.ContentType) ? "Unknown" : context.ContentType)
        </Badge>
    </DataTableItem>
    <DataTableItem Label="Size">
        @HumanizeFileSize(context.Size)
    </DataTableItem>
    <ActionButtons>
        <Stack Justify="StackJustify.End">
            @if (ActionsFragment != null)
            {
                @ActionsFragment(context)
            }
        </Stack>
    </ActionButtons>
</DataTable>